<html>
<head>
    <title>用户编号登陆</title>
    <meta charset="UTF-8"/>
    <script src="/js/config.js"></script>
</head>
<body>
手机号码：<input id="phone" type="text" value="" />
<input id="btncode" type="button" value="获取验证码" />
验 证 码：<input id="code" type="text" value="" />
<input id="btn" type="button" value="编号登陆" />
<a href="login.html">编号登陆</a>
<script src="/js/jquery.js"></script>
<script>
    $(document).ready(function () {

        $("#btncode").click(function () {
            $("#btncode").attr("disabled", true);
            $("#btncode").val("发送中...");
            var phone=$("#phone").val();
            var url = apiurl+"/API/user/JsonUserNoPhoneCode?phone="+phone;
            //alert(url);
            $.ajax({
                url: url,
                type: "GET",
                dataType: "json", //指定服务器返回的数据类型
                success: function(result) {
                    if(result.stat=="100")
                    {
                        alert("发送成功!!");
                    }
                    else
                    {
                        alert(result.message);
                        $("#btncode").attr("disabled", false);
                    }
                }
            });
        });

        $("#btn").click(function () {
            var phone=$("#phone").val();
            var code=$("#code").val();
            var url = apiurl+"/API/user/JsonUserNoPhoneLogin?phone="+phone+"&code="+code;
            alert(url);
            $.ajax({
                url: url,
                type: "GET",
                dataType: "json", //指定服务器返回的数据类型
                success: function(result) {
                    if(result.msgCode=="000000")
                    {
                        alert("登陆成功!!");
                        window.location="/user/user.html";
                    }
                    else
                    {
                        alert(result.errorDetail);
                    }
                }
            });
        });
    });
</script>

</body>
</html>